<?php

$GLOBALS['TL_DCA']['tl_content']['list']['global_operations']['editPage']
     = array
			(
				'label'               => &$GLOBALS['TL_LANG']['MSC']['m17BT']['editPage'],
				'button_callback' => array('tl_m17BackendTools', 'editPage')

);

class tl_m17BackendTools extends Backend
{
    
    public function editPage($href, $label, $title, $className, $attributes, $strTable, $root)
    {
        
        $dbObj = $this->Database->prepare('
            SELECT
                pid
            FROM
                tl_article
            WHERE
                id = ?
        ')->execute($this->Input->get('id'));

        $out = '<a href="contao/main.php?do=page&act=edit&id='.$dbObj->pid.'&showOnlyMain=1" class="m17editPage" data-lightbox="page 765 80%">'.$label.'</a>';
        
        return $out;
    }
}